<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>bootstrap卡片下</title>
    <link rel="stylesheet" href="../css/bootstrap.css">
</head>
<style>
    main {
        margin: 1%;
        padding: 1%;
    }
</style>

<body>

    <main>
        <div class="card">
            <div class="card-header">
                <ul class="nav nav-tabs card-header-tabs">
                    <li class="nav-item">
                        <a href="#" class="nav-link active">首页</a>
                    </li>
                    <li class="nav-item">
                        <a href="#" class="nav-link">介绍</a>

                    </li>
                    <li class="nav-item">
                        <a href="#" class="nav-link">关于   </a>

                    </li>
                </ul>
            </div>
        </div>

        <div class="card-deck mt-2">
            <div class="card">
                <img src="../img/back.jpg" alt="back.jpg" class="card-img-top">
                <div class="card-body">
                    <h4 class="card-title">标题</h4>
                    <p class="card-text">
                        内容.....
                    </p>
                </div>
                <div class="card-footer">
                    <small class="text-muted">text-muted</small>
                </div>
            </div>
            <div class="card">
                <img src="../img/back.jpg" alt="back.jpg" class="card-img-top">
                <div class="card-body">
                    <h4 class="card-title">标题</h4>
                    <p class="card-text">
                        内容.....
                    </p>
                </div>
                <div class="card-footer">
                    <small class="text-muted">text-muted</small>
                </div>
            </div>
            <div class="card">
                <img src="../img/back.jpg" alt="back.jpg" class="card-img-top">
                <div class="card-body">
                    <h4 class="card-title">标题</h4>
                    <p class="card-text">
                        内容.....
                    </p>
                </div>
                <div class="card-footer">
                    <small class="text-muted">text-muted</small>
                </div>
            </div>
        </div>
        

    </main>


    <script src="../js/jquery.min.js"></script>
    <script src="../js/bootstrap.js"></script>
    <script>
        $('.nav-link').on('click', (nav)=>{
            $('.active')['0']['className'] = 'nav-link'
            if(nav.target.className){
                nav.target.className += ' active' 
            }
        })
    </script>
</body>

</html>